-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add e2e tests #9
Conversation
hack/e2e.sh
Outdated
|
||
ginkgo ./tests/e2e \ | ||
-- \ | ||
--install-kubernetes=${INSTALL_KUBERNETES} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SC2086 Double quote to prevent globbing and word splitting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goland shell scripts plugins
hack/e2e.sh
Outdated
KIND_NAME=${KIND_NAME:-e2e-test} | ||
KIND_CONFIG=${KIND_CONFIG:-${ROOT}/hack/kind-config.yaml} | ||
|
||
KUBECONFIG=${KUBECONFIG:-~/.kube/${KIND_NAME}.kind.config} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I didn't use kind cluster, the KUBECONFIG is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you will be able to use the existing kubernetes via the following command:
INSTALL_KUBERNETES=false make e2e
tests/e2e/nebulacluster/util.go
Outdated
|
||
func getNebulaCluster(namespace, name string) *v1alpha1.NebulaCluster { | ||
imagePullPolicy := corev1.PullIfNotPresent | ||
storageClassName := "standard" // standard, fast-disks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be configurable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following priority will be applied:
STORAGE_CLASS
environment variable- The default ClassName in kubernetes
- The other ClassName in kubernetes
tests/e2e/nebulacluster/util.go
Outdated
PodSpec: v1alpha1.PodSpec{ | ||
Replicas: pointer.Int32Ptr(1), | ||
Image: "vesoft/nebula-graphd", | ||
Version: "v2-nightly", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using the latest version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default: v2-nightly
, and I'll add config for the image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default to use v2-nightly
, and you can set the NEBULA_VERSION
environment variable to specify the version.
NEBULA_VERSION=v2.0.1 make e2e
tests/e2e/suites.go
Outdated
"--repo", "https://charts.jetstack.io", | ||
"--namespace", helmNamespace, | ||
"--create-namespace", | ||
"--version", "v1.3.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be configurable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default to use v1.3.1
, and you can set the INSTALL_CERT_MANAGER_VERSION
environment variable to specify the version.
INSTALL_CERT_MANAGER_VERSION=v1.3.1 make e2e
helmArgs := []string{ | ||
"install", helmName, | ||
"https://github.com/openkruise/kruise/releases/download/v0.8.1/kruise-chart.tgz", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be configurable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default to use v0.8.1
, and you can set the INSTALL_KRUISE_VERSION
environment variable to specify the version.
INSTALL_KRUISE_VERSION=v0.8.1 make e2e
return | ||
} | ||
helmName := "kruise" | ||
helmNamespace := "default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set namespace to kruise-system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The helmNamespace
means the helm's namespace nor the crd's namespace to install.
In the helm repo, there have a namespace resource kruise-system
. So, if set helmNamespace
to kruise-system
, we need to create kruise-system
first or add --create-namespce
to helm command.
But it already a namespace kruise-system
in helm repo.
There's a conflict. I haven't found a better way at the moment.
return true | ||
} | ||
|
||
func helmInstall(name, namespace string, workloadNamespaces []string, args ...string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think install helm charts [kruise,cert-manager,nebula-operator] by e2e.sh shell scripts more concise, we can check if they installed or not in e2e framework
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shell script should be executed before the test starts. And there may be different behaviors between each test case. With go
, we can have better control.
"USE e2e_test;" + | ||
"CREATE TAG IF NOT EXISTS person(name string, age int);" + | ||
"CREATE EDGE IF NOT EXISTS like(likeness double);" | ||
err = waitForExecuteNebulaSchema(30*time.Second, 2*time.Second, graphLocalAddress, graphLocalPort, "user", "pass", executeSchema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we run the e2e test without creating a new kind cluster, the graphLocalAddress and graphLocalPort will not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It dose work. And it have tested.
The network traffic forwards to api-server
, and then to graphd
.
We can access the api-server
, so the network traffic that forward to graphd
.
82b4067
to
48615ba
Compare
9de51f1
to
fb77c6e
Compare
LGTM |
No description provided.